<?php
/*
+--------------------------------------------------------------------------
|   AffiliStore 2
|   ========================================
|   Web: http://www.affilistore.com
|   Email: admin (at) affilistore (dot) com
|	License Type: AffiliStore 2 is NOT open source software and limitations apply 
|   Licence Info: Visit AffiliStore website and click on 'Licence'
+--------------------------------------------------------------------------
*/
if (eregi(".inc.php",$HTTP_SERVER_VARS['PHP_SELF']) || eregi(".inc.php",$_SERVER['PHP_SELF'])) {
	echo "<html>\r\n<head>\r\n<title>Forbidden 403</title>\r\n</head>\r\n<body><h3>Forbidden 403</h3>\r\nThe document you are requesting is forbidden.\r\n</body>\r\n</html>";
	exit;
}



// category listing
$getPageLinksTop = mysql_query("SELECT * FROM affiliSt_pages WHERE parent = '0' ORDER BY pageOrder ASC");
$pageLinksTop = mysql_fetch_assoc($getPageLinksTop);

$box_content = new XTemplate ("skins/".$configSkin['value']."/styleTemplates/pagelinkstop.tpl");
$storedCategory = '';


// create navigation from category and brond list
do { 
	if ($pageLinksTop['id'] != 1) {
	$catresult = $pageLinksTop['id'];
		if ($storedCategory != $catresult) {
		
		// array link ids
		$linkIds = array(3,4,5,14,7,8,9);
		// get link location options
		$linkOpt = explode(":", $pageLinksTop['location']);
			if ($linkOpt[0] == 1) {
		
				if ($catresult == $_GET['page']) {
						$box_content->assign("FONTSTYLE",'topNavOn');
						$box_content->assign("LINKSTYLE",'topLinkOn');
				} else {
						$box_content->assign("FONTSTYLE",'topNavOff');
						$box_content->assign("LINKSTYLE",'topLinkOff" style="color:#ffffff;');
				}
					
				if ($navOpt[7] == 1) {
				// html perma
				$box_content->assign("LINKDATA",$installDir['value'].'page/'.$catresult.'/'.urltxt($pageLinksTop['name']).'.html');
				} else {
				// php link
				$box_content->assign("LINKDATA",$installDir['value'].'index.php?case=page&page='.$catresult);
				}		
			
			
			$box_content->assign("DATA",$pageLinksTop['name']);
			if (in_array((int)$pageLinksTop['id'], $linkIds)){
				$box_content->assign('PAGEID', $pageLinksTop['id']);
				$box_content->assign('MENUANCHOR','menuanchorclass');
			}
			else {
				$box_content->assign('MENUANCHOR','');
			}
			$box_content->parse("pagelinkstop.li");	
			$storedCategory = $catresult;
			}
		} else {
		$catresult = ucwords(strtolower($pageLinksTop['id']));
		}
	}
} while ($pageLinksTop = mysql_fetch_assoc($getPageLinksTop)); 


			
$box_content->assign("SKIN",$configSkin['value']);
$box_content->parse("pagelinkstop");
$box_content = $box_content->text("pagelinkstop");
?>